const INFO_KEY = 'warehourse_login_key'

// 获取员工登录信息
export const getEmpInfo = () => {
  const defaultEmpInfo = { token: '', id: '', userType: '', username: '' }
  const result = localStorage.getItem(INFO_KEY)
  return result ? JSON.parse(result) : defaultEmpInfo
}

// 存储员工登录信息
export const setEmpInfo = (obj) => {
  localStorage.setItem(INFO_KEY, JSON.stringify(obj))
}

// 移除员工登录信息
export const removeEmpInfo = () => {
  localStorage.removeItem(INFO_KEY)
}
